<template>
  <div class="account">
    资源管理
    <button @click="sisui">点击打开弹窗</button>
    <xion1 ref="child1Container" />
    <xion2 @save="save" />
    <el-dialog
      title="提示"
      :visible.sync="dialogVisible"
      width="30%"
      :before-close="handleClose"
    >
      <enit ref="dianjishuju" @FromData="fromdata" />
      <span slot="footer" class="dialog-footer">
        <el-button @click="dialogVisible = false">取 消</el-button>
        <el-button type="primary" @click="sisuai">确 定</el-button>
      </span>
    </el-dialog>
    <br>
    <h3>点击获取另一个组件的数据</h3>
    <button @click="fangyu">点击获取</button>
    <br>
    <el-input
      v-model="input"
      style="width:200px"
      suffix-icon="el-icon-date"
      placeholder="请输入内容"
      :disabled="false"
    />
    <div style="margin-top: 15px;">
      <el-input v-model="input3" disabled style="width:200px" placeholder="请输入内容" class="input-with-select">

        <el-button slot="append" icon="el-icon-search" @click="zyanyan" />
      </el-input>
    </div>
    <!-- 弹窗显示 -->
    <el-dialog
      title="提示"
      :visible.sync="tanchuang"
      width="30%"
    >
      <enits ref="yanyanyyds" @xfqyyds="newshuju" />
      <span slot="footer" class="dialog-footer">
        <el-button @click="zenfan">取 消</el-button>
        <el-button type="primary" @click="lishuo">确 定</el-button>
      </span>
    </el-dialog>
  </div>
</template>

<script>
// import bus from '../../../components/EventBus'
import xion1 from './xion1'
import xion2 from './xion2'
import enit from './enit'
import enits from './enits.vue'
export default {
  components: { enit, xion1, xion2, enits },
  data() {
    return {
      input: '',
      input3: '',
      dialogVisible: false,
      tanchuang: false,
      fjyyyds: ''
    }
  },
  methods: {
    cuanson() {
      // const si = '羽凡'
      // bus.$emit('cusn', si)
    },
    zenfan() {
      this.tanchuang = !this.tanchuang
    },
    newshuju(val) {
      this.fjyyyds = val
    },
    lishuo() {
      this.$refs.yanyanyyds.cuanson()
      console.log(this.fjyyyds)
      this.input3 = this.fjyyyds
      this.tanchuang = !this.tanchuang
    },
    zyanyan() {
      console.log(111)
      this.tanchuang = !this.tanchuang
    },
    fromdata(val) {
      console.log(val)
    },
    sisui() {
      this.$refs.dianjishuju.xfaaq()
      this.dialogVisible = !this.dialogVisible
    },
    handleClose() {},
    sisuai() {
      this.dialogVisible = false
      console.log(this.$store.state)
      console.log(this.$store.state.enit)
      console.log(this.$store.state.enit.from)
    },
    save() {
      this.$refs.child1Container.sisui()
      this.$refs.child1Container.aaa()
      this.$refs.child1Container.sisui()
    },
    fangyu() {
      // bus.$on('test', function(val) {
      //   console.log(val)
      // })
      const sisui = [{
        name: '阿斯顿你就',
        id: 1,
        adsnkl: {
          asdoo: '啊撒旦艰苦'
        }
      }]
      console.log(sisui.map((ite) => ({ ...ite, ...ite.adsnkl })))
      console.log(111)
    }
  }
}
</script>

<style lang="scss" scoped>

</style>
